﻿using MESBaseis.Domain.BaseEntities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MESBaseis.Domain.ZSH
{
    /// <summary>
    /// 工艺流程步骤表
    /// </summary>
    public class ProcessFlowStep : BaseModel
    {
        /// <summary>
        /// 工艺流程ID
        /// </summary>
        public int ProcessFlowId { get; set; }

        /// <summary>
        /// 工序ID
        /// </summary>
        public int ProcessId { get; set; }

        /// <summary>
        /// 步骤序号
        /// </summary>
        public int StepOrder { get; set; }

        /// <summary>
        /// 该步骤的负责人 (可以覆盖工序的默认负责人)
        /// </summary>
        [StringLength(50)]
        public string? StepResponsiblePerson { get; set; }

        /// <summary>
        /// 该步骤的所属部门 (可以覆盖工序的默认部门)
        /// </summary>
        [StringLength(100)]
        public string? StepDepartment { get; set; }

        /// <summary>
        /// 步骤备注
        /// </summary>
        [StringLength(500)]
        public string? StepRemarks { get; set; }

        // 导航属性
        /// <summary>
        /// 所属工艺流程
        /// </summary>
        [ForeignKey("ProcessFlowId")]
        public virtual ProcessFlow ProcessFlow { get; set; } = null!;

        /// <summary>
        /// 所属工序
        /// </summary>
        [ForeignKey("ProcessId")]
        public virtual Process Process { get; set; } = null!;
    }
}
